import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Login from "../views/login.vue"
import Register from "../views/register.vue"
import Book from "../views/book.vue"
import Category from "../views/category.vue"
import User from "../views/user.vue"
import Role from "../views/role.vue"
import Permission from "../views/permission.vue"
import Borrow from "../views/borrow.vue"
const routes = [
  {
    path: '/',
    name: 'home',
    component: Book
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/register',
    name: 'register',
    component: Register
  },
  {
    path: '/book',
    name: 'book',
    component: Book
  },
  {
    path: '/category',
    name: 'category',
    component: Category
  },
  {
    path: '/user',
    name: 'user',
    component: User
  },
  {
    path: '/role',
    name: 'role',
    component: Role
  },
  {
    path: '/permission',
    name: 'permission',
    component: Permission
  },
  {
    path: '/borrow',
    name: 'borrow',
    component: Borrow
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
